package com.xu.cloud.common.process;

import com.xu.cloud.common.pojo.http.req.BaseRequest;
import com.xu.cloud.common.pojo.http.resp.BaseResponse;

/**
 * 请求处理器
 *
 * @author xuguan
 * @since 2023/11/23
 */
public interface IHandler {
    // whether you need handle
    default boolean needHandle(BaseRequest request) {
        return true;
    }

    // request handler
    default void preProcess(BaseRequest request) {

    }

    // response handler
    default void postProcess(BaseRequest request, BaseResponse response) {

    }

    // complete handler
    default void completeProcess(BaseRequest request, BaseResponse response, Exception e) {

    }
}
